/*
 * Host.h
 *
 *  Created on: Jan 26, 2012
 *      Author: jiabin
 */

#ifndef HOST_H_
#define HOST_H_

#include <string>
#include <netinet/in.h>

class Host
{
private:
	sockaddr_in addr;

	// TCP if false
	bool udp;

public:
	Host(const std::string& ip, int port, bool isUDP);

	inline const sockaddr_in& getAddr() const
	{
		return addr;
	}

	inline bool isUdp() const
	{
		return udp;
	}

protected:
	static unsigned int convertIP(const std::string& ipstr);
};

#endif /* HOST_H_ */
